package com.org.model;

/**
 * PromotionProductId entity. @author MyEclipse Persistence Tools
 */

public class PromotionProductId implements java.io.Serializable {

	// Fields

	private Promotion promotion;
	private Product product;

	// Constructors

	/** default constructor */
	public PromotionProductId() {
	}

	/** full constructor */
	public PromotionProductId(Promotion promotion, Product product) {
		this.promotion = promotion;
		this.product = product;
	}

	// Property accessors

	public Promotion getPromotion() {
		return this.promotion;
	}

	public void setPromotion(Promotion promotion) {
		this.promotion = promotion;
	}

	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof PromotionProductId))
			return false;
		PromotionProductId castOther = (PromotionProductId) other;

		return ((this.getPromotion() == castOther.getPromotion()) || (this
				.getPromotion() != null
				&& castOther.getPromotion() != null && this.getPromotion()
				.equals(castOther.getPromotion())))
				&& ((this.getProduct() == castOther.getProduct()) || (this
						.getProduct() != null
						&& castOther.getProduct() != null && this.getProduct()
						.equals(castOther.getProduct())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getPromotion() == null ? 0 : this.getPromotion().hashCode());
		result = 37 * result
				+ (getProduct() == null ? 0 : this.getProduct().hashCode());
		return result;
	}

}